﻿using System;
using System.Collections.Generic;
using System.Data;

namespace Vampirewal.Core.OperationExcelService
{
    /// <summary>
    /// 操作Excel服务接口
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IVampirewalOperationExcelService
    {

        ///// <summary>
        ///// 保存Excel文件名
        ///// </summary>
        //string SaveFileName { get; }

        ///// <summary>
        ///// Excel文件保存地址
        ///// </summary>
        //string SaveFilePath { get; }

        ///// <summary>
        ///// Excel类型
        ///// </summary>
        //ExcelType excelType { get; }

        ///// <summary>
        ///// 设置
        ///// </summary>
        ///// <param name="saveFileName">设置保存文件的文件名</param>
        ///// <param name="saveFilePath">设置保存文件的路径</param>
        ///// <param name="type">设置excel类型</param>
        //void Setting(string saveFileName, string saveFilePath, ExcelType type);

        /// <summary>
        /// 执行导出
        /// </summary>
        /// <typeparam name="T">实体类型</typeparam>
        /// <param name="EntityList">导出数据源</param>
        /// <exception cref="Exception"></exception>
        public void ExportDataToExcel<T>(List<T> EntityList, string SaveFilePath, ExcelType excelType) where T : class, new();

        /// <summary>
        /// 将excel中的数据导入到DataTable中
        /// </summary>
        /// /// <param name="sheetName">表名</param>
        /// <param name="isFirstRowColumn">第一行是否是DataTable的列名</param>
        /// <param name="FileFullPath">文件完整路径</param>
        /// <returns>返回的DataTable</returns>
        DataTable ExcelToDataTable(string sheetName, bool isFirstRowColumn, string FileFullPath);

        /// <summary>
        /// 导入EXCEL文件转成List
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="isFirstRowColumn">第一行是否是DataTable的列名</param>
        /// <param name="FileFullPath">文件完整路径</param>
        /// <returns></returns>
        List<T> ExcelToList<T>(bool isFirstRowColumn, string FileFullPath);
    }
}
